package main

import (
	"fmt"
	"strconv"
)

func main() {

	var num1 = 99
	var num2 float64 = 23.456
	var b = true
	var str string

	str = fmt.Sprintf("%d", num1)
	fmt.Printf("str type %T str=%v \r\n", str, str)

	str = fmt.Sprintf("%f", num2)
	fmt.Printf("str type %T str=%v \r\n", str, str)

	//bool转换
	str = fmt.Sprintf("%t", b)
	fmt.Printf("str type %T str=%v \r\n", str, str)

	fmt.Println("==== 第二种方式进行转换=====")
	str = strconv.FormatBool(b)

	//10 表示小数点后10 位，
	str = strconv.FormatFloat(num2, 'f', 10, 64)
	fmt.Printf("str type %T str=%v \r\n", str, str)

}
